home *** CD-ROM | disk | FTP | other *** search
/ The Business Master (3rd Edition) / The Business Master (3rd Edition).iso / files / grapties / sd204 / box.doc < prev    next >
Encoding:
Text File  |  1980-01-01  |  58.1 KB  |  1,690 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                                     BOX
  20.  
  21.                           A Program for Creating
  22.                          and Editing Screen Images
  23.  
  24.                                 version 1.3
  25.  
  26.             (C) Copyright 1986,1987,1988 by Nescatunga Software
  27.                             All Rights Reserved
  28.  
  29.                          Registration Fee: $20.00
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.           =======================================================
  70.           BOX USER GUIDE                                 PAGE 2
  71.           =======================================================
  72.  
  73.  
  74.           TABLE OF CONTENTS
  75.  
  76.  
  77.           License and Registration Information..................3
  78.           Introduction..........................................4
  79.           Making Backup Copies..................................5
  80.           Running BOX on a Floppy-Based System..................5
  81.           Installing BOX on a Hard Disk.........................5
  82.           Running BOX on a Hard Disk System.....................6
  83.           The Main Menu.........................................6
  84.             Draw Menu...........................................7
  85.             Load from Disk......................................8
  86.             Save to Disk........................................8
  87.             ASCII File Format...................................9
  88.             Memory File Format..................................9
  89.             Packed File Format.................................10
  90.             Path/Directory.....................................11
  91.             Clear Screen.......................................11
  92.             Exit Program.......................................11
  93.           The Draw Menu Functions..............................12
  94.             Type Labels........................................12
  95.               Insert Mode (Ins)................................12
  96.               Delete Line (F9).................................13
  97.               Insert Line (F10)................................13
  98.             Draw Boxes.........................................13
  99.             Move...............................................14
  100.             Color Change.......................................14
  101.             Block Functions....................................15
  102.             Select Box Drawing Style...........................16
  103.             Repeat.............................................16
  104.             Paint Areas........................................17
  105.             Erase..............................................18
  106.             On the Fly Changes.................................19
  107.              ASCII Table.......................................19
  108.           Turbo Pascal Programming Considerations..............20
  109.             Displaying ASCII Format Screens....................20
  110.             Displaying Memory Format Screens...................20
  111.             Displaying Packed Format Screens...................21
  112.             Using BOX Screens for Context Sensitive Help.......21
  113.           Address.Pas, a Complete Example Program..............23
  114.           Capturing screens from other programs with GRAB......23
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.           =======================================================
  136.           BOX USER GUIDE                                 PAGE 3
  137.           =======================================================
  138.  
  139.  
  140.           LICENSE AND REGISTRATION
  141.  
  142.           BOX is user supported software copyrighted by the
  143.           author who reserves all rights.  You are granted a
  144.           limited license to use the program under the terms
  145.           below.
  146.  
  147.           You may copy the BOX disk to evaluate it or to give to
  148.           others to evaluate so long as no price or other
  149.           consideration is charged.
  150.  
  151.           Shareware distribution organizations may copy the BOX
  152.           diskette and share it with their members so long as no
  153.           price is charged other than a reasonable distribution
  154.           fee not to exceed the cost of a diskette and handling.
  155.  
  156.           The program, associated files and documentation must
  157.           always be distributed together.  You may not modify the
  158.           program or the documentation.  You may not reprint the
  159.           program manual in any way.
  160.  
  161.           Schools may copy BOX as many times as needed so long as
  162.           the registration fee has been paid for each building
  163.           the program will be used in.
  164.  
  165.  
  166.           REGISTRATION FEE
  167.  
  168.           If you find BOX useful please register as a BOX user by
  169.           sending $20.00 to:
  170.  
  171.                 Nescatunga Software
  172.                 Box 5942
  173.                 Katy, TX 77450
  174.  
  175.           For registering you will receive the latest version of
  176.           the BOX program and a printed copy of the
  177.           documentation.
  178.  
  179.           Although BOX is relatively small and tightly focused in
  180.           its purpose, it represents many hours of work.  We can
  181.           continue to enhance BOX and develop other shareware
  182.           products ONLY if you support the product and the
  183.           shareware concept.
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.           =======================================================
  202.           BOX USER GUIDE                                 PAGE 4
  203.           =======================================================
  204.  
  205.           INTRODUCTION
  206.  
  207.           BOX and the other programs on this diskette represent a
  208.           sophisticated screen design and display system.  With
  209.           the BOX system you can add eye-popping data entry
  210.           screens and instant context-sensitive help screens to
  211.           your Turbo Pascal and C programs.  The components of
  212.           the system are:
  213.  
  214.             BOX, the world's best screen designing editor.
  215.  
  216.             LOADFILE.PAS, a Pascal Unit which contains complete
  217.             source code for displaying BOX-created screens in
  218.             your programs.  Also on the diskette are several
  219.             other useful Pascal Units such as IOSTUFF and
  220.             MENUBOX.
  221.  
  222.             ADDRESS.PAS, a complete example program in Turbo
  223.             Pascal source code, which shows how to use BOX-
  224.             created screens for program logos, for context
  225.             sensitive help and for database entry.
  226.  
  227.             GRAB, a memory resident screen capture program you
  228.             can use to take snapshots of screens in any program.
  229.  
  230.             Full documentation for all of the above.
  231.  
  232.           The main attraction, however, is BOX, the screen
  233.           editor.  With it you can create snazzy, professional-
  234.           looking data entry screens and help screens in minutes
  235.           rather than hours.
  236.  
  237.           To use BOX you start with a blank screen.  Then, using
  238.           special screen editing functions, you type, paint,
  239.           shade, fill, draw boxes or erase in any color
  240.           combination you desire.  BOX has several unique
  241.           functions such as REPEAT, BLOCK and ASCII-Table-
  242.           Selection which are tailored specifically to screen
  243.           creation and far exceed what is available in text
  244.           editors.  Drawing intricate intersecting boxes is
  245.           literally child's play.
  246.  
  247.           When you've got the screen just right you SAVE the
  248.           screen image to disk.  This screen image file now is
  249.           available to be loaded directly onto the screen from a
  250.           Pascal or C program.  Later if you decide to make
  251.           changes to the screen it is a snap to LOAD it back into
  252.           BOX's editor and make the changes.
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.           =======================================================
  268.           BOX USER GUIDE                                 PAGE 5
  269.           =======================================================
  270.  
  271.           BOX works in regular text mode and uses regular ASCII
  272.           characters so that any BOX-created screen may be
  273.           displayed on any color or monochrome monitor.
  274.  
  275.           Applications for BOX screens include:
  276.  
  277.                 Input screens for data base entry
  278.                 Menus
  279.                 Help Screens
  280.                 Program Logo screens
  281.                 Demonstration Screens
  282.                 Program Prototyping
  283.                 Computer "doodling"
  284.  
  285.           BOX will run on any IBM PC (CGA, EGA or Monochrome)
  286.           under DOS.  We have tested BOX on several IBM
  287.           compatible PCs and have discovered no problems.  Be
  288.           aware however that BOX incorporates several low-level
  289.           functions which may not work on some IBM near-
  290.           compatibles.  Please let us know the nature of any
  291.           problems you discover on your system.
  292.  
  293.           The diskette also contains ADDRESS.PAS, a complete
  294.           example application.  ADDRESS uses BOX screens for its
  295.           program logo, as context-sensitive help screens and as
  296.           a database entry screen.  The ADDRESS program includes
  297.           procedures which pop the BOX-created screens onto the
  298.           monitor instantly.  You are free to use these
  299.           procedures in your own Turbo Pascal programs.  The
  300.           procedures are not complicated and could be easily
  301.           translated into C for example.
  302.  
  303.           Also included with ADDRESS are several other powerful
  304.           Pascal Units taken from Turbo Overdrive Package, TOP,
  305.           another shareware product from Nescatunga Software.
  306.           The full TOP package costs $20.00 from Nescatunga
  307.           Software and comes with source code and printed
  308.           documentation.
  309.  
  310.           MAKING BACKUP COPIES
  311.  
  312.           BOX is not copy protected so make as many back-up
  313.           copies as you think you will need.  To make back-up
  314.           copies or distribution copies for other users first
  315.           boot up your computer with DOS.  Place the BOX diskette
  316.           in the A drive and a blank, formatted diskette in the B
  317.           drive.  At the A prompt type the following command to
  318.           copy all files from the A diskette to the B diskette:
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.           =======================================================
  334.           BOX USER GUIDE                                 PAGE 6
  335.           =======================================================
  336.  
  337.                 A> COPY A:*.* B:
  338.  
  339.  
  340.           RUNNING BOX ON A FLOPPY-BASED SYSTEM
  341.  
  342.           To use BOX on a floppy disk system first boot up your
  343.           computer with DOS.  Put the BOX diskette in the A drive
  344.           and type the following command at the A prompt:
  345.  
  346.                 A> BOX
  347.  
  348.           The BOX program will start by displaying a logo with
  349.           the word BOX outlined on the screen.  Remember that BOX
  350.           looks for its logo file and its help files on the same
  351.           drive where it is started.  So don't start the program
  352.           from another drive, as shown in the example below.
  353.  
  354.                 B> A:BOX    (Wrong)
  355.  
  356.           After you have started BOX you may easily change the
  357.           default data drive or directory.
  358.  
  359.           INSTALLING BOX ON A HARD DISK
  360.  
  361.           To install BOX on a hard disk first make a new
  362.           directory to hold the BOX files.  Change to that
  363.           directory and, with the BOX diskette in the A drive,
  364.           copy all BOX files to the directory as shown below:
  365.  
  366.                 C> MD\BOXX
  367.                 C> CD\BOXX
  368.                 C> COPY A:*.* C:
  369.  
  370.           The three commands above will create a new directory
  371.           named BOXX, change to that directory and copy all BOX
  372.           files from the BOX diskette to the BOXX directory on
  373.           the hard disk.  If you would prefer to leave the BOX
  374.           documentation and example programs on the disk then
  375.           substitute the following COPY statements for the one
  376.           above:
  377.  
  378.                 C> COPY A:BOX.EXE C:
  379.                 C> COPY A:BOXHELP.* C:
  380.                 C> COPY A:BOXLOGO. C:
  381.  
  382.  
  383.  
  384.           RUNNING BOX ON A HARD DISK SYSTEM
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.           =======================================================
  400.           BOX USER GUIDE                                 PAGE 7
  401.           =======================================================
  402.  
  403.           To start the BOX program, issue the following two
  404.           commands to change to the BOXX directory and initiate
  405.           the program:
  406.  
  407.                 C> CD\BOXX
  408.                 C> BOX
  409.  
  410.           Remember that BOX must be started from the same
  411.           directory and drive as its associated files.  You can
  412.           easily change the default path later.
  413.  
  414.  
  415.           THE MAIN MENU
  416.  
  417.           BOX is a snap to use because it uses the following
  418.           conventions which are standard with many popular
  419.           software products:
  420.  
  421.                 "Point and Shoot" Menus
  422.                 "Escape" for abort or return to menu
  423.                 "F1" for Help
  424.  
  425.           In fact, if you're in a hurry to try BOX, go ahead.
  426.           The program's user interface is intuitive and you will
  427.           likely be using all of BOX's features (except for BOX's
  428.           "on the fly" drawing changes which are well hidden)
  429.           without reading this manual.  However to get the most
  430.           from BOX it is a good idea to come back and read this
  431.           manual later to see if you may have missed a trick or
  432.           two.
  433.  
  434.           If you get stuck running BOX just hit F1 for help and
  435.           one of BOX's seven context-sensitive help screens will
  436.           appear.  These help screens are a condensed version of
  437.           this documentation.
  438.  
  439.           While we're talking about BOX's help screens it is
  440.           interesting to note that they were created with BOX and
  441.           are displayed by the same Pascal routines given in the
  442.           example programs on the diskette.
  443.  
  444.           When you start BOX the main menu will appear.  To
  445.           select an action from the menu move the lightbar with
  446.           the arrow keys and hit enter.  Or just hit the first
  447.           letter of item's description.  For example hit S if you
  448.           want to SAVE from the main menu.  Hitting the letter S
  449.           is equivalent to placing the lightbar on SAVE and
  450.           hitting enter.  After you become familiar with the
  451.           commands you probably will find this second approach
  452.           more efficient.
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.           =======================================================
  466.           BOX USER GUIDE                                 PAGE 8
  467.           =======================================================
  468.  
  469.  
  470.           Hitting the Esc while under one of BOX's menus will
  471.           abort that menu and take you to the next higher menu.
  472.           On the main menu however, hitting the Esc key will
  473.           cause an Exit from the BOX program (after a safety
  474.           prompt).
  475.  
  476.           EDIT MENU
  477.  
  478.           If you select EDIT MENU from the main menu, another
  479.           menu will appear with a list of selections for drawing
  480.           and painting boxes on the screen.  From the EDIT menu
  481.           you may :
  482.  
  483.                 Type labels and text on the screen
  484.                 Draw boxes like an etch-a-sketch
  485.                 Move around the screen without drawing
  486.                 Change background and foreground colors
  487.                 Move, clone and paint blocks of the screen
  488.                 Choose between four box drawing styles
  489.                 Repeat any character in any direction
  490.                 Paint the boxes any color (including blink)
  491.                 Erase lines drawn in error
  492.  
  493.  
  494.           These seven functions make it easy, even fun, to create
  495.           a screen image.  I'll return to the EDIT menu later and
  496.           cover each of the functions in detail.  But first let's
  497.           cover the other functions on the main menu.
  498.  
  499.           LOAD FROM DISK
  500.  
  501.           The LOAD function loads a screen image file you have
  502.           saved previously with the SAVE TO DISK function
  503.           described in the next section.  To load a file first
  504.           select the file format the original screen was saved
  505.           under; either ASCII, Memory or Packed (see description
  506.           under SAVE below).  BOX will then display a directory
  507.           of files on the current drive/path and prompt you for
  508.           the file name.  Type the file name you want to load and
  509.           hit enter.
  510.  
  511.           If the file you want to load is not on the current
  512.           drive/path you have two options.  First you may hit
  513.           escape to return to the main menu and there select
  514.           PATH/DIRECTORY to change the drive/path then return to
  515.           the LOAD screen to load the file.  Or you may simply
  516.           type the drive and directory prefix to the file name at
  517.           the bottom of the LOAD screen.
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.           =======================================================
  532.           BOX USER GUIDE                                 PAGE 9
  533.           =======================================================
  534.  
  535.  
  536.           You may LOAD standard ASCII files created with other
  537.           editors (including Turbo Pascal's) and word processors.
  538.           But BOX will LOAD only the leftmost 80 characters of
  539.           the first 25 lines.  Take care not to LOAD a file
  540.           longer than 25 lines then SAVE it with the same name.
  541.           BOX will overwrite the original file but save only the
  542.           first 25 lines.  Any additional lines will be lost.
  543.  
  544.  
  545.           SAVE TO DISK
  546.  
  547.           The save function writes a disk file containing the
  548.           screen image you have created and edited with BOX's
  549.           DRAW and TYPE functions.  To use SAVE you must first
  550.           select the file format and, when prompted, provide a
  551.           file name.  Please note that BOX remembers the last
  552.           file name you used so BOX will SAVE the modified screen
  553.           under that same file name unless you change it.
  554.  
  555.  
  556.           ASCII FILE FORMAT
  557.  
  558.           With BOX you may store a screen image in one of three
  559.           different formats; the ASCII format, the Memory format
  560.           and the Packed format.
  561.  
  562.           The ASCII format is the simplest and most standard of
  563.           the three because it saves the screen in a text format
  564.           that most word processors and editors (including Turbo
  565.           Pascal's editor) recognize.  ASCII files may therefore
  566.           be further edited and printed with many other editors
  567.           and word processors or included directly in you
  568.           program's source code.
  569.  
  570.           However saving a BOX screen image in the ASCII format
  571.           has some disadvantages.  First, ASCII files lose all of
  572.           the color attributes you may have drawn or painted on
  573.           the screen.  In addition ASCII screen images must be
  574.           displayed line-by-line which results in a slower
  575.           display.
  576.  
  577.  
  578.           MEMORY FILE FORMAT
  579.  
  580.           Memory format files, because they are essentially a
  581.           snapshot "dump" of the video memory buffer, retain all
  582.           color attributes (including blink) and can be instantly
  583.           flashed on the screen using the code examples later in
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.           =======================================================
  598.           BOX USER GUIDE                                 PAGE 10
  599.           =======================================================
  600.  
  601.           this manual.  Memory files, however, will look like
  602.           gibberish to most editors and word processors.  Usually
  603.           this will present no problem since you can always edit
  604.           memory format files with BOX.
  605.  
  606.           Many of the commonly available screen-capture programs
  607.           use the Memory format.  GRAB.COM, a program contained
  608.           on the BOX disk, is a TSR (memory resident) screen-
  609.           capture program which you can use to capture screen
  610.           from other programs.  When activated with ALT-PrtSc,
  611.           GRAB saves the current screen image to the current disk
  612.           drive in a Memory format.   There are more instructions
  613.           for using GRAB in it own documentation file.
  614.  
  615.  
  616.           PACKED FILE FORMAT
  617.  
  618.           Except for one difference, Packed format files are
  619.           identical to Memory format files.  They retain all
  620.           color attributes and can be popped on the display
  621.           instantly.  The difference is that Packed format files
  622.           use a simple run-length-encoding algorithm to compress
  623.           the size of the file when it is written to the disk.
  624.           You can save considerable space by using Packed format
  625.           files if your screens have several blank lines or
  626.           bordered boxes.
  627.  
  628.           Memory format files always require 4000 bytes of
  629.           storage.  A typical Packed format file will require
  630.           around 2000 bytes.  You should be aware, however, that
  631.           in extreme cases (where every other character is
  632.           different for example) a Packed format file can
  633.           actually be larger than 4000 characters.  If you are
  634.           not sure which format to use, save your screen under
  635.           both formats with a different name then examine the
  636.           size of the files with a Directory command.
  637.  
  638.           Another consideration is that, because your Pascal
  639.           program must decode and expand the packed file (the
  640.           procedure is shown in the example programs) it takes
  641.           just a fraction of a second longer to load than a
  642.           Memory format file.  The difference is barely
  643.           perceptable even on slower 8086 computers.
  644.  
  645.           You must decide which of the three formats gives the
  646.           greatest advantage to your requirements.  Personally I
  647.           prefer the Memory format for its simplicity and
  648.           flexibility.
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.           =======================================================
  664.           BOX USER GUIDE                                 PAGE 11
  665.           =======================================================
  666.  
  667.           In saving BOX files you may use any file names you
  668.           wish.  Please note, however, that if you do not add
  669.           file extensions (a period followed by three characters
  670.           at the end of your file name) BOX will add them for you
  671.           using the following conventions:
  672.  
  673.                 ASCII files     xxxxxxxx.ASC
  674.                 Memory files    xxxxxxxx.MEM
  675.                 Packed files    xxxxxxxx.PAK
  676.  
  677.           If you choose to use the conventions above for your
  678.           file names, BOX will highlight any file names that
  679.           match the format you are using when it displays the
  680.           directory of files during LOADing.
  681.  
  682.           PATH/DIRECTORY
  683.  
  684.           With the PATH/DIRECTORY facility, which is available
  685.           from the Main menu, you can change the drive/path where
  686.           BOX will store or retrieve screen-image files.
  687.  
  688.  
  689.           CLEAR SCREEN
  690.  
  691.           The CLEAR SCREEN choice on the main menu brings up a
  692.           submenu with several screen-initialization functions.
  693.  
  694.              CLEAR
  695.  
  696.              The CLEAR function erases all characters on the
  697.              screen and sets the colors to those you have chosen.
  698.              Use it when you have just saved a screen image and
  699.              want to start with a fresh blank screen.
  700.  
  701.              COLOR CHANGE
  702.  
  703.              This choice on the CLEAR menu brings up a color
  704.              smorgasbord for selecting the colors you wish to
  705.              have on the cleared screen.
  706.  
  707.              FILL
  708.  
  709.              Select FILL to fill the entire screen with a
  710.              character.  An ASCII character selector box will pop
  711.              up to allow you to select any of the 255 ASCII
  712.              characters.  With these characters you can create
  713.              many interesting patterns.
  714.  
  715.              PAINT SCREEN
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.           =======================================================
  730.           BOX USER GUIDE                                 PAGE 12
  731.           =======================================================
  732.  
  733.  
  734.              PAINT changes the background and foreground colors
  735.              on the screen but does not erase the characters.
  736.  
  737.  
  738.           X EXIT
  739.  
  740.           Select EXIT on the main menu to leave the BOX program.
  741.           If your last step was to SAVE a file, BOX will return
  742.           control to DOS immediately.  However if your last
  743.           operation was not a SAVE, BOX will ask you if you
  744.           really want to EXIT.
  745.  
  746.  
  747.           THE EDIT MENU FUNCTIONS
  748.  
  749.           Now let's return to the EDIT MENU and examine each of
  750.           its functions in more detail.  When you select EDIT
  751.           from the main menu, BOX will display a list of
  752.           selections for drawing and painting boxes on the screen
  753.           including:
  754.  
  755.                 Type labels and text on the screen
  756.                 Draw boxes like an etch-a-sketch
  757.                 Move the cursor around the screen without drawing
  758.                 Change background and foreground colors
  759.                 Move or paint blocks on the screen
  760.                 Select from among four box drawing styles
  761.                 Repeat any character in any direction
  762.                 Paint the boxes any color (including blink)
  763.                 Erase lines drawn in error
  764.  
  765.  
  766.           Let's cover each of these functions in order:
  767.  
  768.           TYPE LABELS
  769.  
  770.           TYPE, which is the first function on the EDIT Menu, is
  771.           a simple, full-screen text editor you can use to type
  772.           text on a screen image.  After you have selected TYPE
  773.           simply locate the cursor where you want it on the
  774.           screen and type whatever text you need.  Since BOX
  775.           works with only one screen at a time the limits of the
  776.           typing area is 80 characters wide by 25 lines long -- a
  777.           full screen in 80 character text mode.
  778.  
  779.  
  780.           INSERT MODE
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.           =======================================================
  796.           BOX USER GUIDE                                 PAGE 13
  797.           =======================================================
  798.  
  799.           In the TYPE function you may toggle the insert mode on
  800.           and off by hitting the Ins. key.  A large block cursor
  801.           indicates that Insert is on, a small line cursor
  802.           indicates that Insert is off.  If Insert is on, all
  803.           characters to the right of the cursor will be pushed to
  804.           the right when you type.  BOX does not word wrap nor
  805.           does it save the characters that you push off the
  806.           screen.  Please remember that if you have the insert
  807.           mode on and you hit the enter key you will break the
  808.           line at the cursor location and carry the tail of the
  809.           line to a new line below.  If insert mode is off the
  810.           cursor will jump to the next line but it will not carry
  811.           the tail of the line.
  812.  
  813.  
  814.           DELETE LINE => F9
  815.  
  816.           To delete a line, place the cursor on the line you wish
  817.           to delete and hit F9.  All lines below the deleted line
  818.           are brought up one line and a blank line will be
  819.           inserted at the bottom of the screen.  The blank line
  820.           will be in the current color scheme.
  821.  
  822.  
  823.           INSERT LINE => F10
  824.  
  825.           To insert a blank line, place the cursor just below the
  826.           location you want the line inserted and hit F10.  All
  827.           lines below the inserted line will be pushed down one
  828.           and the last line of the screen will be lost.
  829.  
  830.  
  831.           DRAW BOXES
  832.  
  833.           Select DRAW BOXES from the DRAW MENU to draw lines and
  834.           boxes using the arrow keys on the cursor control pad.
  835.  
  836.           Think of DRAW as lowering a drawing pen onto the
  837.           drawing pad (the screen).  Lines will follow wherever
  838.           you direct the cursor--up, down, left or right. If you
  839.           cross another line special logic in BOX will
  840.           automatically draw the proper intersection or joining
  841.           character.  DRAW will use whatever colors and box style
  842.           you have previously selected.  So you may wish to
  843.           select COLOR CHANGE and BOX CHANGE from the DRAW MENU
  844.           before you select DRAW.
  845.  
  846.  
  847.           MOVE
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.           =======================================================
  862.           BOX USER GUIDE                                 PAGE 14
  863.           =======================================================
  864.  
  865.  
  866.           MOVE is the opposite of DRAW.  MOVE lifts the box-
  867.           drawing pen so that you may move the cursor with the
  868.           arrow keys to a new location without trailing a line
  869.           behind you.  When you have moved the cursor to the new
  870.           location, select DRAW to start drawing again. You may
  871.           also move the cursor without drawing if you select the
  872.           TYPE function from the menu.
  873.  
  874.  
  875.           COLOR CHANGE
  876.  
  877.           When you select COLOR CHANGE from the DRAW MENU a color
  878.           selection smorgasbord will appear on the screen.  To
  879.           select the colors you want simply use the up and down
  880.           arrow keys to select Foreground or Background and the
  881.           left and right arrow keys to select the color.  A small
  882.           arrow will move over the chart showing you which color
  883.           you have picked and a sample of the colors will appear
  884.           to the right of the display.
  885.  
  886.           Note that you may select from sixteen foreground and
  887.           sixteen background colors.  The second eight background
  888.           colors are not really colors but cause the foreground
  889.           characters to blink by turning on the blink bit in the
  890.           color attribute byte.  A little bit of blink, like hot
  891.           pepper sauce, goes a long way.
  892.  
  893.           The color combination you select will stay in effect
  894.           for the rest of the BOX session or until you change it
  895.           regardless of whether you are typing text, drawing
  896.           boxes or painting.
  897.  
  898.           Be sure you don't select the same background and
  899.           foreground colors.  If you do everything you draw or
  900.           type will be invisible.
  901.  
  902.  
  903.           BLOCK FUNCTIONS
  904.  
  905.           When you select BLOCK from the Draw menu, your first
  906.           step is to identify the portion of the screen, or the
  907.           block, you want to work with.  Do this by moving the
  908.           cursor to one corner of the block and hitting enter,
  909.           then moving the cursor to the opposite corner of the
  910.           block and hitting enter again.  After you anchor the
  911.           cursor on the first corner the program will highlight
  912.           the block area by displaying it in reverse video.
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.           =======================================================
  928.           BOX USER GUIDE                                 PAGE 15
  929.           =======================================================
  930.  
  931.           After you have identified the block size, the program
  932.           will display a submenu of functions.
  933.  
  934.              MOVE BLOCK
  935.  
  936.              If you select MOVE BLOCK from the BLOCK menu simply
  937.              use the cursor keys to move the identified block
  938.              around the screen until you have placed it where you
  939.              want it.  Hit enter to position the block.  The area
  940.              where the original block was located is blanked out.
  941.  
  942.              CLONE BLOCK
  943.  
  944.              CLONE BLOCK is the same as MOVE BLOCK except that
  945.              the original block is not blanked out but is left
  946.              intact.  So if you have created a fancy small
  947.              pattern in one area of the screen that you want to
  948.              repeat at other locations, use CLONE to move it.
  949.  
  950.              PAINT BLOCK
  951.  
  952.              PAINT allows you to change the background and
  953.              foreground colors of the selected block area of the
  954.              screen.  Other PAINT functions are more global and
  955.              operate on the interior of box lines, for example.
  956.              But BLOCK PAINT allows you to pinpoint just where
  957.              you want to change the colors.
  958.  
  959.              BLANK BLOCK
  960.  
  961.              This function blanks the selected area of the
  962.              screen.
  963.  
  964.              DEFINE NEXT BLOCK
  965.  
  966.              Use DEFINE to select another area of the screen for
  967.              block operations.
  968.  
  969.  
  970.           SELECT BOX-DRAWING STYLE
  971.  
  972.           Returning now to functions available from the main DRAW
  973.           menu, the SELECT BOX TYPE facility allows you to select
  974.           from among  double line, single line or combination
  975.           single/double line boxes.  Simply pick the one you
  976.           like.  The box type you select will stay in effect
  977.           until you change it even if you are not drawing.
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.           =======================================================
  994.           BOX USER GUIDE                                 PAGE 16
  995.           =======================================================
  996.  
  997.           REPEAT
  998.  
  999.           The REPEAT function has two parts.  First REPEAT will
  1000.           allow you to enter the character you want to repeat.
  1001.           An ASCII character selection window will pop up on the
  1002.           right side of the screen.  Browse the ASCII table by
  1003.           using the Up and Down arrow keys and PageDown and
  1004.           PageUp keys.  Then hit enter to select.
  1005.  
  1006.           In the second step REPEAT will pause while you position
  1007.           the cursor anywhere on the screen.  When you have
  1008.           positioned the cursor where you want it, hit enter to
  1009.           trigger the REPEAT function.  You may now "draw" the
  1010.           repeat character any direction using the arrow keys.
  1011.           REPEAT works just like DRAW except you get to select
  1012.           any of the PC's 255 characters to draw with.
  1013.  
  1014.           Note that the character you select from the ASCII Table
  1015.           will stay at-the-ready for later Repeat-Drawing if you
  1016.           need it.  Just hit ALT-R to invoke the on-the-fly
  1017.           repeat function and you can "draw" the last-selected
  1018.           ASCII character in any direction.  The ASCII Table can
  1019.           also be brought up On-the-fly by hitting ALT-A.
  1020.  
  1021.  
  1022.           PAINT AREAS
  1023.  
  1024.           The PAINT function contains several choices for
  1025.           painting parts or all of the screen different colors.
  1026.  
  1027.              COLOR
  1028.  
  1029.              Before selecting any of the paint functions it is
  1030.              necessary to choose the background and foreground
  1031.              colors you want the painted area to be.  The COLOR
  1032.              smorgasbord allows the color selection.
  1033.  
  1034.              INTERIOR PAINT
  1035.  
  1036.              This function paints the interior of boxes but stops
  1037.              painting on the box boundary.  To use the function
  1038.              move the cursor inside the box to be painted and hit
  1039.              enter.  PAINT will start from the cursor position
  1040.              painting in every direction until it hits the box
  1041.              lines.  Make sure there are no gaps in the box
  1042.              because PAINT will leak through the gap and paint
  1043.              the entire screen.
  1044.  
  1045.              LINE PAINT
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.           =======================================================
  1060.           BOX USER GUIDE                                 PAGE 17
  1061.           =======================================================
  1062.  
  1063.  
  1064.              This function will follow any boxes or lines you
  1065.              have drawn and paint them the color you have
  1066.              selected.  Put the cursor on the line you want to
  1067.              paint and hit enter.
  1068.  
  1069.              SCREEN PAINT
  1070.  
  1071.              Choose this function to change the colors of the
  1072.              entire screen.
  1073.  
  1074.              FILL
  1075.  
  1076.              The FILL function fills the area selected with a
  1077.              character of your choice.  When you select the
  1078.              function an ASCII selector table will pop up for
  1079.              character selection and you will be prompted to move
  1080.              the cursor inside the area to be filled.  FILL will
  1081.              not leak into or out of boxes.  The function is
  1082.              often used to create attractive background patterns
  1083.              around windows on the screen.
  1084.  
  1085.           These PAINT functions sounds complicated but play with
  1086.           them a while and you will get the hang of them right
  1087.           away.  Just remember that if you select the same
  1088.           background color that you have in the box to start
  1089.           with, PAINT will appear as if it is not working if
  1090.           there are no typed labels in the box.
  1091.  
  1092.           With the exception of the FILL function, the PAINT
  1093.           functions do not destroy characters you have typed on
  1094.           the screen.  They simply change the color attributes.
  1095.           This fact can be used to advantage if you want to leave
  1096.           the background color the same but change the
  1097.           foreground.  For example if you have white characters
  1098.           on a blue background and you wish to have yellow
  1099.           characters on the same blue background then simply
  1100.           select yellow on blue and paint the area you want to
  1101.           change.
  1102.  
  1103.           The PAINT functions test to see if they have completed
  1104.           their tasks by looking at the colors all around where
  1105.           they start.  If the colors there are the desired PAINT
  1106.           colors the function thinks it is done and does no
  1107.           further processing.  So be sure to move the cursor into
  1108.           an area that is not the paint color to start.
  1109.  
  1110.           If you have several areas to paint the same color move
  1111.           the cursor into the next area and hit ALT-P to invoke
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.           =======================================================
  1126.           BOX USER GUIDE                                 PAGE 18
  1127.           =======================================================
  1128.  
  1129.           the on-the-fly PAINT function.
  1130.  
  1131.  
  1132.           ERASE
  1133.  
  1134.           While you are drawing, sooner or later you will turn a
  1135.           corner too soon or make some other mistake.  To correct
  1136.           these mistakes, select ERASE.  In essence, ERASE writes
  1137.           a blank character wherever the cursor is directed.
  1138.           ERASE does not restore the background color to what it
  1139.           was before.  To accomplish this you must make a color
  1140.           change before you start ERASING.
  1141.  
  1142.  
  1143.  
  1144.           ON THE FLY CHANGES
  1145.  
  1146.           After you become familiar with the DRAW MENU functions
  1147.           and memorize the initials -- D for DRAW, M for MOVE and
  1148.           so on -- you will want to take advantage of the ON THE
  1149.           FLY CHANGES.  This facility allows you to change
  1150.           drawing functions on-the-fly while you are drawing
  1151.           simply by pressing a key.  When you use this feature
  1152.           there is no need to return to the menu and select
  1153.           another function.
  1154.  
  1155.           For example while you are drawing a box you can hit
  1156.           ALT-M and BOX immediately switches you into the MOVE
  1157.           function.  You may then move the cursor a few spaces,
  1158.           hit ALT-D and you're drawing a new box.  ON-THE-FLY
  1159.           functions are quick and powerful but they happen
  1160.           without fanfare so you will have to remember what you
  1161.           are doing.
  1162.  
  1163.           ON THE FLY functions duplicate those available from the
  1164.           menu except for PAINT and REPEAT which work slightly
  1165.           differently.  In their ON-THE-FLY forms PAINT and
  1166.           REPEAT are toggle functions you may turn on and off.
  1167.           For example if you are DRAWING you could hit ALT-M for
  1168.           MOVE, move the cursor inside a box and then hit ALT-P
  1169.           to toggle PAINT on and PAINT the box.  This procedure
  1170.           varies from the three-part PAINT and REPEAT sequence
  1171.           the program steps you through when these functions are
  1172.           selected from the menu.
  1173.  
  1174.                 ON-THE-FLY FUNCTIONS AVAILABLE
  1175.  
  1176.                         ALT-T = TYPE LABELS
  1177.                         ALT-D = DRAW BOXES
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.           =======================================================
  1192.           BOX USER GUIDE                                 PAGE 19
  1193.           =======================================================
  1194.  
  1195.                         ALT-M = MOVE
  1196.                         ALT-C = COLOR CHANGE
  1197.                         ALT-B = BLOCK FUNCTIONS
  1198.                         ALT-S = SELECT BOX TYPE
  1199.                         ALT-E = ERASE
  1200.                         ALT-A = ASCII TABLE
  1201.  
  1202.                         ALT-R = REPEAT (TOGGLE ONLY)
  1203.                         ALT-P = PAINT  (TOGGLE ONLY)
  1204.  
  1205.  
  1206.  
  1207.           ASCII TABLE (ALT-A)
  1208.  
  1209.           One unique on-the-fly function that is not directly
  1210.           available from the menu (it is available indirectly
  1211.           from the REPEAT function) is the ASCII Table.  If you
  1212.           want to use one of the upper or lower ASCII characters
  1213.           which cannot be entered from the keyboard on the
  1214.           screen, simply hit ALT-A.  An ASCII Table will pop up
  1215.           on the right side of the screen with a selector box
  1216.           that you move with the arrow keys.  Move the selector
  1217.           box over the character you want, scrolling with the
  1218.           arrow keys or PageDown or PageUp if necessary, then hit
  1219.           enter to select.  The ASCII table will disappear and
  1220.           the character you selected will be printed on the
  1221.           screen at the last cursor position.
  1222.  
  1223.           The ASCII character you last selected from the ASCII
  1224.           table will stay at-the-ready to be used in the REPEAT
  1225.           function.  To select the on-the-fly REPEAT function hit
  1226.           ALT-R.  This combination of ASCII Table selection and
  1227.           REPEAT is a very powerful facility to create
  1228.           interesting and unusual effects with some of the
  1229.           "strange" ASCII characters.  Some amazing displays can
  1230.           be created using the block and shading characters in
  1231.           unusual color combinations.  The possibilities for
  1232.           attention-getting program logo screens are endless.
  1233.  
  1234.  
  1235.  
  1236.           TURBO PASCAL PROGRAMMING CONSIDERATIONS
  1237.  
  1238.           Creating screen images with BOX is easy and fun but it
  1239.           is only half the story.  The real payoff comes when you
  1240.           integrate the screens into your own Turbo Pascal
  1241.           program.
  1242.  
  1243.           Displaying and using BOX-created screens in your Turbo
  1244.           Pascal programs is relatively easy.  The Pascal Unit
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.           =======================================================
  1258.           BOX USER GUIDE                                 PAGE 20
  1259.           =======================================================
  1260.  
  1261.           LOADFILE.PAS contains source code you can use to load
  1262.           any of the three BOX format screens onto the display.
  1263.  
  1264.           DISPLAYING ASCII FORMAT SCREENS
  1265.  
  1266.           To display ASCII format screens created with the BOX
  1267.           editor, add a procedure to your program which reads the
  1268.           file produced by BOX and displays it line by line.  The
  1269.           following logic, a simplified version of Procedure
  1270.           Load_ASCII in Unit LOADFILE.PAS, will give you the
  1271.           idea.
  1272.  
  1273.           VAR
  1274.                 FilevarA   : Text;
  1275.           BEGIN
  1276.                 Assign(FilevarA,'ANYFILE.ASC');
  1277.                 Reset(FilevarA);
  1278.                 ClrScr;
  1279.                 For II := 1 to 25 do
  1280.                   Begin
  1281.                     Readln(FilevarA,TempStr);
  1282.                     GoToXY(1,II);
  1283.                     Write(TempStr);
  1284.                   End;
  1285.                 Close(FilevarA);
  1286.           END;
  1287.  
  1288.  
  1289.           The example above will load BOX ASCII format file
  1290.           ANYFILE.ASC onto the display.  Copy and use the
  1291.           procedure above or the more flexible procedure given in
  1292.           Unit LoadFile in your own programs.
  1293.  
  1294.           DISPLAYING MEMORY FORMAT SCREENS
  1295.  
  1296.           Displaying a memory format screen requires a bit of
  1297.           fiddling with the PC's video buffer.  Forturnately you
  1298.           don't have to know how it works because We've included
  1299.           all the routines you need in Units IOSTUFF and
  1300.           LOADFILE.
  1301.  
  1302.           However for those that are curious here's a few
  1303.           technical details.  To display a screen you have saved
  1304.           under the memory format you must read in the BOX-
  1305.           created file and move the contents of the file directly
  1306.           into the Video display memory buffer.  This buffer is
  1307.           located at memory address B800 (hex) for the color (CGA
  1308.           or EGA) adapters and at memory address B000 (hex) for
  1309.           the monochrome adapter.  So the logic to display a
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.           =======================================================
  1324.           BOX USER GUIDE                                 PAGE 21
  1325.           =======================================================
  1326.  
  1327.           memory file is as shown below:
  1328.  
  1329.           TYPE
  1330.              Map     = Record     { one char. and color attr.}
  1331.                            ScrCh : Char;
  1332.                            ScrAt : Byte;
  1333.                          End;
  1334.              Screen  = Array[1..25,1..80] of Map; {video memory}
  1335.  
  1336.           VAR
  1337.               FilevarM   : File;
  1338.               LoadScr    : Screen;  {holding screen}
  1339.               ColorScr   : Screen absolute $B800:0000; {color}
  1340.               MonoScr    : Screen absolute $B000:0000; {Mono}
  1341.  
  1342.           BEGIN
  1343.               Assign(FilevarM,'ANYFILE.MEM');
  1344.               Reset(FilevarM,4000);
  1345.               BlockRead(FilevarM,LoadScr,1); {read in the screen}
  1346.                                            {now move into buffer}
  1347.               Move(LoadScr,ColorScr,4000);   {For CGA}
  1348.           {   Move(LoadScr,MonoScr,4000);  } {For Monochrome}
  1349.               Close(FilevarM);
  1350.               ...
  1351.           END;
  1352.  
  1353.           The example above first reads memory format file
  1354.           ANYFILE.MEM into holding area LoadScr.  Then LoadScr is
  1355.           moved directly into the CGA display memory.  The
  1356.           bracketed statements show how the logic would be
  1357.           changed to display the screen on a monochrome display.
  1358.           When you move the file into the video buffer the screen
  1359.           image will pop onto the display almost instantly.
  1360.  
  1361.           Moving data directly into the CGA adapter's memory will
  1362.           cause interference or "snow" on the screen.  The
  1363.           interference happens so fast that it is not particulary
  1364.           objectionable.  However there is a way to avoid the
  1365.           snow by using MoveToScreen, a special inline code
  1366.           routine given in Unit IOSTUFF.  There are also routines
  1367.           in IOSTUFF which determine the type of adapter
  1368.           installed so that your programs will work on any kind
  1369.           of computer.  I recommend you consider using the
  1370.           Load_Mem Procedure in Unit LOADFILE.PAS to take
  1371.           advantage of the advanced functionality.  If you
  1372.           include these Units the logic to display a screen is
  1373.           dead simple:
  1374.  
  1375.                 Load_Mem('ANYFILE.MEM');
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.           =======================================================
  1390.           BOX USER GUIDE                                 PAGE 22
  1391.           =======================================================
  1392.  
  1393.  
  1394.           This statement will pop BOX file ANYFILE.MEM on the
  1395.           screen regardless of type of display.  The screen will
  1396.           appear just as you created it with BOX -- boxes,
  1397.           colors, blink and all.  After you have displayed the
  1398.           screen you are free to write on it with normal Pascal
  1399.           Write statements.
  1400.  
  1401.  
  1402.           DISPLAYING PACKED FORMAT SCREENS
  1403.  
  1404.           Displaying a Packed format screen is similar to
  1405.           displaying a Memory format screen except the packed
  1406.           screen file must be unpacked before it can be
  1407.           displayed.  A Packed format file uses a simple run
  1408.           length encoding structure.  The idea is that if there
  1409.           are 20 blanks in a row on the screen, the Packed format
  1410.           just saves the blank character once along with the run
  1411.           length of 20.  Here's a snippet of logic to show you
  1412.           how to unpack a packed screen image:
  1413.  
  1414.           TYPE
  1415.  
  1416.              Map     = Record     { one char. and color attr.}
  1417.                            ScrCh : Char;
  1418.                            ScrAt : Byte;
  1419.                          End;
  1420.  
  1421.              Screen  = Array[1..25,1..80] of Map; {video memory}
  1422.  
  1423.              Pack  = Record
  1424.                       PackNm : Byte;  {run length}
  1425.                       PackCh : Char;  {repeated character}
  1426.                       PackAt : Byte;  {repeated attribute}
  1427.                      End;
  1428.  
  1429.           VAR
  1430.              FilevarM   : File;
  1431.              LoadScr    : Screen;
  1432.              ColorScr   : Screen absolute $B800:0000; {color}
  1433.              MonoScr    : Screen absolute $B000:0000; {Mono}
  1434.              Packbuf    : Array[1..2000] of Pack;
  1435.              II,JJ,Sloc,SX,SY,NumRec  : Integer;
  1436.  
  1437.           BEGIN
  1438.              Sloc := 1;              {SLoc is location on screen}
  1439.              Assign(FilevarM,'ANYFILE.PAK');
  1440.              Reset(FilevarM);
  1441.              BlockRead(FilevarM,PackBuf,48,NumRec);
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.           =======================================================
  1456.           BOX USER GUIDE                                 PAGE 23
  1457.           =======================================================
  1458.  
  1459.              JJ := 0;
  1460.              While Sloc < 2001 do
  1461.                 Begin                 {start unpacking}
  1462.                     JJ := JJ + 1;
  1463.                     For II := 1 to Packbuf[JJ].PackNm do
  1464.                      Begin
  1465.                       SY := (SLoc-1) div 80 + 1;       {row}
  1466.                       SX := (SLoc-1) mod 80 + 1;       {column}
  1467.                           {move in the character and attribute}
  1468.                       LoadScr[SY,SX].ScrCh := Packbuf[JJ].PackCh;
  1469.                       LoadScr[SY,SX].ScrAt := Packbuf[JJ].PackAt;
  1470.                       Inc(SLoc);  {increment the screen location}
  1471.                      End;
  1472.                 End;
  1473.              Move(LoadScr,ColorScr,4000); {for CGA}
  1474.           {  Move(LoadScr,MonoScr,4000);} {for Mono}
  1475.              Close(FilevarM);
  1476.           END;
  1477.  
  1478.  
  1479.           After the Packed format file has been unpacked it looks
  1480.           just like a Memory format file and may then be moved
  1481.           directly into the video memory buffer as shown in the
  1482.           move statements above.  The example procedure LOAD_PAK
  1483.           contained on your disk in file LOADFILE.PAS is a more
  1484.           comprehensive example of the technique and is ready to
  1485.           use in your own programs.
  1486.  
  1487.  
  1488.           USING BOX SCREENS FOR CONTEXT SENSITIVE HELP
  1489.  
  1490.           It is relatively easy to create a context-sensitive
  1491.           help facility in your Turbo Pascal program with the BOX
  1492.           screen editor and a few simple routines such as those
  1493.           contained on the BOX diskette in file KEY2.PAS.
  1494.  
  1495.           The first step is to decide how many help screens you
  1496.           need and during what processing steps you want the help
  1497.           screens to display.  Now use the BOX editor to create
  1498.           each of the help screens.  You may enter text, draw
  1499.           lines, use different colors and get as fancy as you
  1500.           wish.  After you have completed each help screen save
  1501.           it using a memory or packed format.
  1502.  
  1503.           Now turn to your Turbo Pascal program.  You will need
  1504.           to make a decision and then make several minor
  1505.           additionsto your program to tailor the help facility.
  1506.           The decision is where you are going the store the help
  1507.           screen images.  You have three choices;
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.           =======================================================
  1522.           BOX USER GUIDE                                 PAGE 24
  1523.           =======================================================
  1524.  
  1525.  
  1526.           (1) leave the files on disk and bring them in when
  1527.           needed,
  1528.           (2) preload the files into an array defined in your
  1529.           program's storage or
  1530.           (3) preload screens on unallocated memory (the heap).
  1531.  
  1532.           The first apprach is simple, clean and saves memory but
  1533.           it is comparitively slow.  The second and third
  1534.           approaches take more memory but allow eyepopping speed.
  1535.           We use alternative three (store help screens on the
  1536.           heap) in the BOX program.
  1537.  
  1538.           To copy this approach first examine the help-related
  1539.           procedures in Unit KEY2.PAS.  You must first call
  1540.           Procedure SETHELPMAX to set the number of active help
  1541.           screens you intend to use.  Then you must call
  1542.           Procedure HELPLOAD once for each help screen to store
  1543.           the screen on the heap.  Here's the actual help-loading
  1544.           statements we use in BOX.
  1545.  
  1546.            Display('Loading Help Files',1,25);
  1547.            SetHelpMax(7);
  1548.            HelpLoad(1,'BoxHelp.1');
  1549.            HelpLoad(2,'BoxHelp.2');
  1550.            HelpLoad(3,'BoxHelp.3');
  1551.            HelpLoad(4,'BoxHelp.4');
  1552.            HelpLoad(5,'BoxHelp.5');
  1553.            HelpLoad(6,'BoxHelp.6');
  1554.            HelpLoad(7,'BoxHelp.7');
  1555.            Wait;
  1556.  
  1557.           These statements establish seven help screens and load
  1558.           the actual screens in order on the heap.  The numbers
  1559.           are important because they establish the "context"
  1560.           under which the screen will be displayed.
  1561.  
  1562.           To use the concept of contextual help, assign values to
  1563.           the global variable HELPCONTEXT (defined in Unit KEY2)
  1564.           at various locations in your program corresponding to
  1565.           the help screen you want to display.  For example if
  1566.           the help screen for your EDIT function is EDITHELP.MEM
  1567.           and you have assigned it position No. 2 on the heap
  1568.           through the statement HelpLoad(2,'EDITHELP.MEM'); then
  1569.           be sure to set HELPCONTEXT := 2; in the first few
  1570.           statements of your EDIT Procedure.
  1571.  
  1572.           Now all that's left is to intercept each keystroke as
  1573.           it is entered and check it to see if the user has
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.           =======================================================
  1588.           BOX USER GUIDE                                 PAGE 25
  1589.           =======================================================
  1590.  
  1591.           pressed F1 (or whatever you wish the help key to be).
  1592.           If the user has pressed the help key then your program
  1593.           should pop the appropriate help screen on the display.
  1594.           Function NEXTKEY in Unit KEY2 does this for you.  As
  1595.           long as you read in characters with function NEXTKEY,
  1596.           and keep variable HELPCONTEXT set, the routines in Unit
  1597.           KEY2 will do all the work.  The right help screen will
  1598.           flash on the monitor and, when the user hits a key,
  1599.           will disappear leaving him at the exact spot he was
  1600.           when he asked for help.
  1601.  
  1602.           This business of context sensitive help sounds
  1603.           complicated but it is not.  Study the complete example
  1604.           program ADDRESS.PAS to see how it is done.
  1605.  
  1606.  
  1607.           ADDRESS.PAS, A COMPLETE EXAMPLE PROGRAM
  1608.  
  1609.           ADDRESS.PAS on the BOX diskette is a complete Turbo
  1610.           Pascal example program that uses BOX screens in three
  1611.           different ways:
  1612.  
  1613.                 Program Logo screen
  1614.                 Context sensitive help screens
  1615.                 Database entry screen
  1616.  
  1617.           ADDRESS is a simple name and address manager that
  1618.           allows the user to browse, add, change or delete
  1619.           entries from a list of addresses.  The actual database
  1620.           management portion of ADDRESS is simple and
  1621.           unsophisticated to keep the program small.  Rather the
  1622.           emphasis is on the examples of using the BOX screens
  1623.           effectively.
  1624.  
  1625.           The ADDRESS program references several Units from
  1626.           Nescatunga Software's Turbo Overdrive Package, a
  1627.           collection of over 40 procedures and functions.  The
  1628.           Units which are included on the BOX diskette are:
  1629.  
  1630.             IOSTUFF.PAS  -- Low level screen and cursor routines
  1631.             LOADFILE.PAS -- Load BOX screen onto the display
  1632.             MENUBOX.PAS  -- Popup menu window
  1633.             GETLNE.PAS   -- Take user's input from the screen
  1634.             KEY.PAS      -- Keystroke reading and help routines
  1635.  
  1636.           We think you will find these Units extremely powerful
  1637.           and useful.  IOSTUFF alone is worth the price of BOX.
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.           =======================================================
  1654.           BOX USER GUIDE                                 PAGE 26
  1655.           =======================================================
  1656.  
  1657.           CAPTURING SCREENS FROM OTHER PROGRAMS WITH GRAB
  1658.  
  1659.           On the BOX disk you will find the program GRAB.COM, a
  1660.           memory-resident screen capturing program.  GRAB is a
  1661.           program that, when activated by pressing the ALT key
  1662.           and the PrtSc key simultaneously, saves the current
  1663.           screen image to disk under BOX's Memory format.  You
  1664.           can use GRAB to capture screens from other programs and
  1665.           later modify those screens using the BOX editor and
  1666.           incorporate the screens into your own programs.
  1667.  
  1668.           To use GRAB first run the program by typing GRAB at the
  1669.           DOS prompt.  GRAB will print a short message confirming
  1670.           that it has been loaded.  You may now proceed to run
  1671.           any other program you wish.  Whenever you want to save
  1672.           the screen image hit the ALT-PrtSc keys and GRAB will
  1673.           create a Memory format file containing the screen image
  1674.           on the current disk drive.  If the drive or directory
  1675.           has been changed by the program or the batch file, GRAB
  1676.           will write to the new drive and directory.  Later you
  1677.           can copy the files to whatever directory you wish.  It
  1678.           is a good idea to wait until the program you are
  1679.           running is stable (i.e. waiting for a keystroke) before
  1680.           trying to capture the screen.
  1681.  
  1682.           When GRAB saves the screen it assigns a file name using
  1683.           the convention BOXnnn.MEM.  The nnn portion of the file
  1684.           name starts with 000 and is incremented by one for each
  1685.           file saved.  So the first file will be named
  1686.           BOX000.MEM, the second BOX001.MEM and so on.
  1687.  
  1688.           GRAB saves files only in the Memory format but it is
  1689.           easy to covert the file format later with BOX.  Simply
  1690.           LOAD the file using a Memory format and SAVE the file
  1691.           using an ASCII or Packed format.